package ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Check extends JPanel implements ActionListener {
    private JButton returnBut;//返回按钮
    private Atm frame;
    public Check(Atm frame){

        this.frame=frame;

        //空布局
        this.setLayout(null);
        //设置透明
        this.setOpaque(false);

        //返回按钮,返回菜单界面
        returnBut = new JButton("返回");
        returnBut.setBounds(350,280,100,50);
        this.add(returnBut);
        returnBut.addActionListener(this);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==returnBut){
            frame.switchPanel("菜单");
        }

    }
}
